#ifndef _asce_inc_render_menu
#define _asce_inc_render_menu

#include <vector>
#include <string>
#include <cstring>
#include <iostream>
#include <GL/gl.h>   // OpenGL itself.
#include <GL/glu.h>  // GLU support library.
#include <GL/glut.h> // GLUT support library.
#include <GL/glx.h>     // Header file fot the glx libraries.

#include "render_common.h"

#define	MENU_BACKGROUND_PIC_PATH	"img/menu.bmp"

#define MENU_START_LABEL	"Start new game"
#define MENU_LOAD_LABEL		"Load a saved game"
#define MENU_SAVE_LABEL		"Save game"
#define MENU_EXIT_LABEL		"Exit"

#define MENU_RATIO		1.6f

#define MENU_NO_BUTTON_SELECT	-1

#define MENU_NO_CLICK_TEST	-1

#define MENU_BOX_TO_DISPLAY_NONE	0
#define	MENU_BOX_TO_DISPLAY_BACK	1
#define	MENU_BOX_TO_DISPLAY_START	2
#define	MENU_BOX_TO_DISPLAY_LOAD	3
#define MENU_BOX_TO_DISPLAY_SAVE	4
#define MENU_BOX_TO_DISPLAY_EXIT	5


#define	MENU_SEL_LEVEL_PRIMARY		2
#define	MENU_SEL_LEVEL_BOX		3

class		RenderMenu : public RenderCommon
{
public:
  
  RenderMenu();
  virtual ~RenderMenu();
  
  void		init();
  void		render();
  void		normalKeyEvent(unsigned char key, int x, int y);
  void		setupRc();
  void		mousePassiveMotion(int x, int y);
  void		changeSize(GLsizei w, GLsizei h);
  void		mouseEvent(int button, int state, int x, int y);

private:


  int		selectLevel;
  int		buttonSelected;

  // click event
  int		clickPicking;
  // menu box to display
  int		boxToDisplay;

  Image		*backImg;
  GLuint	texture[1];

  int		textHSpace;

  int		ImageLoad(char *filename, Image *image);
  void		LoadGLTextures();


  void		showMenuBox();
  void		showButtons(int buttonSelected);
  void		printButton(char *label, int pos, bool selected);
  void		getBoxToDisplay(int	objHit);

};

#endif
